/*
 * Copyright 2010 Electronic Business Systems Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package gr.ebs.gssdroid.resource;

import java.io.Serializable;


/**
 * @author kman
 *
 */
public class PermissionHolder implements Serializable{

	private String user;
	private String group;
	private boolean read;
	private boolean write;
	private boolean modifyACL;

	/**
	 * Retrieve the user.
	 *
	 * @return the user
	 */
	public String getUser() {
		return user;
	}

	/**
	 * Modify the user.
	 *
	 * @param aUser the user to set
	 */
	public void setUser(String aUser) {
		user = aUser;
	}

	/**
	 * Retrieve the group.
	 *
	 * @return the group
	 */
	public String getGroup() {
		return group;
	}

	/**
	 * Modify the group.
	 *
	 * @param aGroup the group to set
	 */
	public void setGroup(String aGroup) {
		group = aGroup;
	}

	/**
	 * Retrieve the read.
	 *
	 * @return the read
	 */
	public boolean isRead() {
		return read;
	}

	/**
	 * Modify the read.
	 *
	 * @param aRead the read to set
	 */
	public void setRead(boolean aRead) {
		read = aRead;
	}

	/**
	 * Retrieve the write.
	 *
	 * @return the write
	 */
	public boolean isWrite() {
		return write;
	}

	/**
	 * Modify the write.
	 *
	 * @param aWrite the write to set
	 */
	public void setWrite(boolean aWrite) {
		write = aWrite;
	}

	/**
	 * Retrieve the modifyACL.
	 *
	 * @return the modifyACL
	 */
	public boolean isModifyACL() {
		return modifyACL;
	}

	/**
	 * Modify the modifyACL.
	 *
	 * @param aModifyACL the modifyACL to set
	 */
	public void setModifyACL(boolean aModifyACL) {
		modifyACL = aModifyACL;
	}
	
	public String getGroupName(){
		if(group==null)
			return null;
		String[] str = group.split("/");
		return str[str.length-1];
	}

}
